﻿<UserControl
    x:Class="SimpleShell.Views.PageBView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SimpleShell.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="600"
    d:DesignWidth="900"
    xmlns:c="using:nRoute.Components"
    xmlns:i="using:nRoute.Behaviors.Interactivity"
    xmlns:n="using:nRoute.Behaviors"
    xmlns:t="using:nRoute.Behaviors.Triggers"
    c:Page.Title="Your Option">
    
    <i:Interaction.Behaviors>
        <n:BridgeViewModelBehavior />
    </i:Interaction.Behaviors>
    
    <c:Page.PageCommands>
        <c:PageCommand Label="Page B's PageCommand" CommandBinding="{Binding UpdateMessageCommand}"  />
        <c:NavigationCommand Label="Page B's NavigationCommand" Url="Content/PageC" />
        <c:PageCommand Label="Page B's DisabledCommand" IsEnabledBinding="{Binding IsEnabled}" CommandBinding="{Binding UpdateMessageCommand}"/>
    </c:Page.PageCommands>
    
    <Grid Background="#FF447804">
        <TextBlock HorizontalAlignment="Left" Height="50" Margin="12" TextWrapping="Wrap" Text="Your Option" VerticalAlignment="Top" Style="{StaticResource PageSubheaderTextStyle}"/>
        <StackPanel HorizontalAlignment="Left" Margin="12,55,12,0" VerticalAlignment="Top">
            <RadioButton Content="Option A" IsChecked="{Binding OptionA, Mode=TwoWay}" GroupName="OptionGrp" Margin="0,0,0,5" />
            <RadioButton Content="Option B" IsChecked="{Binding OptionB, Mode=TwoWay}" GroupName="OptionGrp" Margin="0,0,0,5" />
            <RadioButton Content="Option C" IsChecked="{Binding OptionC, Mode=TwoWay}" GroupName="OptionGrp" Margin="0,0,0,5" />
            <CheckBox x:Name="EnablerCheckBox"  Content="Enabled Page Command" IsChecked="{Binding IsEnabled, Mode=TwoWay}" Margin="0,0,50,0" />
            <TextBox Text="{Binding Message}" Width="400" Margin="0,50,0,0"  IsReadOnly="True" />
        </StackPanel>
        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="0,0,0,12">
            <Button Width="100" Height="60" Content="Go Back" >
                <i:Interaction.Triggers>
                    <t:EventTrigger EventName="Click">
                        <n:DirectionalNavigateAction Direction="Back" />
                    </t:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            <Button Width="180" Height="60" Content="Navigate to Page A" >
            	<i:Interaction.Triggers>
            		<t:EventTrigger EventName="Click">
            			<n:NavigateAction Url="Content/PageA" />
            		</t:EventTrigger>
            	</i:Interaction.Triggers>
            </Button>
            <Button Width="180" Height="60" Content="Navigate to Page C" >
                <i:Interaction.Triggers>
                    <t:EventTrigger EventName="Click">
                        <n:NavigateAction Url="Content/PageC" />
                    </t:EventTrigger>
                </i:Interaction.Triggers>
                <i:Interaction.Behaviors>
                    <n:BoolValueDisableBehavior ValueBinding="{Binding IsChecked, ElementName=EnablerCheckBox}" />
                </i:Interaction.Behaviors>
            </Button>
        </StackPanel>
    </Grid>
</UserControl>
